import Vue from "vue";

import VueRouter from "vue-router";

Vue.use(VueRouter);

const router = new VueRouter({
  mode: "hash",
  routes: [
    { path: "/", redirect: "/home" }, //

    {
      path: "/login",
      component: () => import("../components/Login.vue"),
      name: "Login",
      meta: {
        showTabbar: false,
      },
    }, //路由懒加载 即用到时加载一把 用不到时静静躺在内存里 这样可以减少性能
    {
      path: "/home",
      component: () => import("../views/home/Home.vue"),
      name: "Home",
      meta: {
        showTabbar: true,
      },
    },
    {
      path: "/find",
      component: () => import("../views/find/Find.vue"),
      name: "Find",
      meta: {
        showTabbar: true,
      },
    },
    {
      path: "/message",
      component: () => import("../views/message/Message.vue"),
      name: "Message",
      meta: {
        showTabbar: true,
      },
     /* 配置二级路由 */
     children:[
      {
        path: 'attention',
        component: () => import('../views/message/attention/Attention.vue')
      },
      {
        path: 'official',
        component: () => import('../views/message/official/Official.vue')
      },
      {
        path: 'chat',
        component: () => import('../views/message/chat/Chat.vue')
      },
      {
        path: 'comment',
        component: () => import('../views/message/comment/Comment.vue')
      },
    ],
    },
    {
      path: "/mine",
      component: () => import("../views/mine/Mine.vue"),
      name: "Mine",
      meta: {
        showTabbar: true,
      },
    },
  ],
  linkActiveClass: "active",
});

export default router;
